import request from '@/utils/request'

/**
 * 获取结算信息
 * @returns
 */
export const findCheckoutInfo = () => {
  return request('/member/order/pre', 'get')
}

/**
 * 添加收货地址信息
 * @param {*} address
 * @returns
 */
export const addAddress = address => {
  return request('/member/address', 'post', address)
}

/**
 * 编辑收货地址信息
 * @param {*} address
 * @returns
 */
export const editAddress = address => {
  return request('/member/address', 'put', address)
}

/**
 * 提交订单
 * @param {*} order
 * @returns
 */
export const createOrder = order => {
  return request('/member/order', 'post', order)
}

/**
 * 获取订单详情
 * @param {*} id
 * @returns
 */
export const findOrder = id => {
  return request('/member/order/' + id, 'get')
}
